import request from '@/utils/request'

export function getDataSourcePageList(params) {
  return request({
    url: '/dataSource/page',
    method: 'get',
    params
  })
}

export function tableList(id) {
  return request({
    url: '/dataSource/tableList',
    method: 'get',
    params: { id }
  })
}

export function list() {
  return request({
    url: '/dataSource/list',
    method: 'get'
  })
}

export function saveDataSource(data) {
  return request({
    url: '/dataSource/save',
    method: 'post',
    data
  })
}

export function updateDataSource(data) {
  return request({
    url: '/dataSource/update',
    method: 'post',
    data
  })
}

export function removeDataSource(id) {
  return request({
    url: '/dataSource/remove',
    method: 'get',
    params: { id }
  })
}

export function tableFiledInfo(params) {
  return request({
    url: '/dataSource/tableFiledInfo',
    method: 'get',
    params
  })
}
export function testDbOnline(params) {
  return request({
    url: '/dataSource/testDbOnline',
    method: 'get',
    timeout: 10000,
    params
  })
}
